pub mod common;
pub mod test_handler;
pub mod user;

use axum::body::Body;
use axum::http::{Request, StatusCode};
use axum::response::IntoResponse;
use log::warn;

pub async fn handler_404(req: Request<Body>) -> impl IntoResponse {
    warn!("404 Not Found, request: {}", req.uri().path());
    (StatusCode::NOT_FOUND, "404 not found\n")
}

pub async fn handler_500(req: Request<String>) -> impl IntoResponse {
    warn!(
        "500 Internal Server Error, request: {}, body: {}",
        req.uri().path(),
        req.body()
    );
    (
        StatusCode::INTERNAL_SERVER_ERROR,
        "500 internal server error\n",
    )
}
